# 定义一个字典
xiaoming = {"name" : "小明",
            "age" : 18 ,
            "gender" : True}

print(xiaoming)

# 取值
print(xiaoming["name"])

# 增加/修改
xiaoming["height"] = 1.7
xiaoming["name"] = "小小明"
print(xiaoming)

# 删除
xiaoming.pop("age")
print(xiaoming)

# 统计键值对数量
print(len(xiaoming))

# 合并字典
temp = {"age":18,
        "weight":75}
xiaoming.update(temp)  # 如果被合并的字典中包含已经存在的键值对，会覆盖原有的键值对
print(xiaoming)

# 清空字典
xiaoming.clear()
print(xiaoming)